package dynamicProxy;

import java.lang.reflect.Proxy;

public class Main {
    public static void main(String[] args) {

        IShop lws = new LWS();

        DynamicPurchasing mDynamic = new DynamicPurchasing(lws);

        ClassLoader loader = lws.getClass().getClassLoader();

        IShop purchasing = (IShop) Proxy.newProxyInstance(loader, new Class[]{IShop.class}, mDynamic);

        purchasing.buy();

    }
}
